<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
      function u() {
        let elementById = document.getElementById("tid");
        alert(elementById.value);
      }
      function h() {
        let m = document.getElementById("tid");
        m.value="杨昊";
      }
    </script>
</head>
<body>
    <input type="text" value="于飞正" id="tid"><br>
    <input type="button" value="获取值" onclick="u()">
    <input type="button" value="设置值" onclick="h()">
</body>
</html>